﻿// ***********************************************************************
// Assembly         : 基础数据
// Author           : 平忠强
// Created          : 07-24-2014
//
// Last Modified By : 平忠强
// Last Modified On : 07-24-2014
using System.Web.Mvc;
using System.Web.Http;

namespace Jw.Web.Areas.Basic
{
    public class BasicAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Basic";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute(
                "Basic_default",
                "Basic/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );

            GlobalConfiguration.Configuration.Routes.MapHttpRoute(
              this.AreaName + "Api",
              "api/" + this.AreaName + "/{controller}/{action}/{id}",
              new { area = this.AreaName, action = RouteParameter.Optional, id = RouteParameter.Optional, namespaceName = new string[] { string.Format("Jw.Web.Areas.{0}.Controllers", this.AreaName) } },
              new { action = new StartWithConstraint() }
            );

        }
    }
}
